<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="../../vuejs/vue.js"></script>
<div id="app">
    <ol>
        <li v-for="n in evenNumbers">{{ n }}</li>
    </ol>
</div>
<div id="app2">
    <ul v-for="set in sets">
        <li v-for="n in even(set)">{{ n }}</li>
    </ul>
</div>
<script>
    new Vue({
        el: "#app",
        data: {
            numbers: [1, 2, 3, 4, 5]
        },
        computed: {
            evenNumbers: function () {
                return this.numbers.filter(function (number) {
                    return number % 2 === 0
                })
            }
        }
    })
    new Vue({
        el: "#app2",
        data: {
            sets: [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]]
        },
        methods: {
            even: function (numbers) {
                return numbers.filter(function (number) {
                    return number % 2 === 0
                })
            }
        }
    })
</script>
</body>
</html>